package com.fxp.landing;

import java.awt.Font;
import java.awt.Frame;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JTextField;

public class ZC extends JFrame {
	JPanel p;
	JLabel text1, text2, text3;
	JPasswordField pass1, pass2;
	JTextField t1;
	JButton j1, j2, j3;

	public ZC() {
		super("学生注册界面");
		p = new JPanel();
		p.setLayout(null);
		text1 = new JLabel("账号:");
		text2 = new JLabel("密码:");
		text3 = new JLabel("确认密码:");
		j1 = new JButton("返回");
		j2 = new JButton("确认注册");
		j3 = new JButton("重置");
		pass1 = new JPasswordField();
		pass2 = new JPasswordField();
		t1 = new JTextField();
		text1.setBounds(150, 100, 100, 30);
		text2.setBounds(150, 160, 100, 30);
		text3.setBounds(90, 220, 150, 30);
		t1.setBounds(230, 100, 300, 30);
		pass1.setBounds(230, 160, 300, 30);
		pass2.setBounds(230, 220, 300, 30);
		j2.setBounds(170, 280, 100, 50);
		j3.setBounds(350, 280, 100, 50);
		j1.setBounds(10, 10, 60, 50);
		text1.setFont(new Font("宋体", 00, 30));
		text2.setFont(new Font("宋体", 00, 30));
		text3.setFont(new Font("宋体", 00, 30));
		j1.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent e) {
				setVisible(false);
				XS xs = new XS();
			}
		});
		j2.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent e) {
				setVisible(false);
				JFrame i;
				i = new JFrame();
				i.setLayout(null);
				JLabel r1;
				r1 = new JLabel("注册成功");
				r1.setBounds(0, 0, 300, 200);
				r1.setFont(new Font("黑体", 00, 50));

				i.add(r1);
				i.setSize(300, 200);
				i.setLocation(600, 500);
				i.setVisible(true);

			}
		});

		j3.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent arg0) {
				pass1.setText(null);
				pass2.setText(null);
				t1.setText(null);
			}
		});
		add(text1);
		add(text2);
		add(text3);
		add(t1);
		add(pass1);
		add(pass2);
		add(j2);
		add(j3);
		add(j1);

		add(p);
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setSize(600, 500);
		setLocation(400, 500);
		setVisible(true);
	}

	public static void main(String args[]) {
		new ZC();
	}
}
